Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

""" 

Book: Building RESTful Python Web Services 

Chapter 8: Testing and Ddeploying an API with Flask 

Author: Gaston C. Hillar - Twitter.com/gastonhillar 

Publisher: Packt Publishing Ltd. - http://www.packtpub.com 

""" 

import os 

 

 

# You need to replace the next values with the appropriate values for your configuration 

basedir = os.path.abspath(os.path.dirname(__file__)) 

DEBUG = True 

PORT = 5000 

HOST = "127.0.0.1" 

SQLALCHEMY_ECHO = False 

SQLALCHEMY_TRACK_MODIFICATIONS = True 

SQLALCHEMY_DATABASE_URI = "postgresql://{DB_USER}:{DB_PASS}@{DB_ADDR}/{DB_NAME}".format(DB_USER="user_name", DB_PASS="password", DB_ADDR="127.0.0.1", DB_NAME="test_messages") 

SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') 

TESTING = True 

SERVER_NAME = '127.0.0.1:5000' 

#Disable CSRF protection in the testing configuration 

WTF_CSRF_ENABLED = False